/*
* Configuration of module: Can
*
* Created by:   qinminyuan
* Copyright:    (C)  
*
* Configured for (MCU):    MCU
*
* Module vendor:           ArcCore
* Generator version:       01.00
*/
#include "Can.h"

static const Can_FilterMaskType vCanFilterMask0=
{
    {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},
    {0,0,0,0,0,0,0,0},
    CAN_IDAM_2_32BIT
};

static const Can_HardwareObjectType CAN_CTRL_0_HOHCfgData[]=
{

    {    /* Hoh0x752 */
        .CanHandleType=CAN_ARC_HANDLE_TYPE_BASIC,
        .CanIdType=CAN_ID_TYPE_STANDARD,
        .CanIdValue=0x00,/*TODO*/
        .CanObjectId=Hoh0x752,
        .CanObjectType=CAN_OBJECT_TYPE_RECEIVE,
        .CanFilterMaskRef=&vCanFilterMask0,/*TODO*/
        .Can_MbMask=0x00000000,/*TODO*/
        .Can_Arc_EOL=FALSE
    },

    {    /* Hoh0x7DF */
        .CanHandleType=CAN_ARC_HANDLE_TYPE_BASIC,
        .CanIdType=CAN_ID_TYPE_STANDARD,
        .CanIdValue=0x00,/*TODO*/
        .CanObjectId=Hoh0x7DF,
        .CanObjectType=CAN_OBJECT_TYPE_RECEIVE,
        .CanFilterMaskRef=&vCanFilterMask0,/*TODO*/
        .Can_MbMask=0x00000000,/*TODO*/
        .Can_Arc_EOL=FALSE
    },

    {    /* Hoh0x7D2 */
        .CanHandleType=CAN_ARC_HANDLE_TYPE_BASIC,
        .CanIdType=CAN_ID_TYPE_STANDARD,
        .CanIdValue=0x00,/*TODO*/
        .CanObjectId=Hoh0x7D2,
        .CanObjectType=CAN_OBJECT_TYPE_TRANSMIT,
        .CanFilterMaskRef=&vCanFilterMask0,/*TODO*/
        .Can_MbMask=0x00000000,/*TODO*/
        .Can_Arc_EOL=FALSE
    },

    {    /* Hoh0x3AE */
        .CanHandleType=CAN_ARC_HANDLE_TYPE_BASIC,
        .CanIdType=CAN_ID_TYPE_STANDARD,
        .CanIdValue=0x00,/*TODO*/
        .CanObjectId=Hoh0x3AE,
        .CanObjectType=CAN_OBJECT_TYPE_RECEIVE,
        .CanFilterMaskRef=&vCanFilterMask0,/*TODO*/
        .Can_MbMask=0x00000000,/*TODO*/
        .Can_Arc_EOL=FALSE
    },

    {    /* Hoh0x3FA */
        .CanHandleType=CAN_ARC_HANDLE_TYPE_BASIC,
        .CanIdType=CAN_ID_TYPE_STANDARD,
        .CanIdValue=0x00,/*TODO*/
        .CanObjectId=Hoh0x3FA,
        .CanObjectType=CAN_OBJECT_TYPE_TRANSMIT,
        .CanFilterMaskRef=&vCanFilterMask0,/*TODO*/
        .Can_MbMask=0x00000000,/*TODO*/
        .Can_Arc_EOL=FALSE
    },

    {
        .Can_Arc_EOL = TRUE,
    }
};

const Can_ControllerConfigType  Can_ControllerCfgData[]=
{

    {
        .CanControllerId=CAN_CTRL_0,
        .CanRxProcessing=CAN_ARC_PROCESS_TYPE_INTERRUPT,
        .CanTxProcessing=CAN_ARC_PROCESS_TYPE_INTERRUPT,
        .CanWakeupProcessing=CAN_ARC_PROCESS_TYPE_INTERRUPT,
        .CanBusOffProcessing=CAN_ARC_PROCESS_TYPE_INTERRUPT,
        .CanControllerBaudRate=500,
        .CanControllerPropSeg=0,/* (SJW) */
        .CanControllerSeg1=13,
        .CanControllerSeg2=2,
        .Can_Arc_Hoh=CAN_CTRL_0_HOHCfgData,
        .Can_Arc_Loopback=FALSE
    },
    
};
extern void CanIf_RxIndication(uint16 Hrh, Can_IdType CanId, uint8 CanDlc,const uint8 *CanSduPtr);
extern void CanIf_TxConfirmation(PduIdType canTxPduId);
const Can_CallbackType CanCallbackConfigData = {
     NULL, //CanIf_CancelTxConfirmation,
     CanIf_RxIndication,
     NULL,//CanIf_ControllerBusOff,
     CanIf_TxConfirmation,
     NULL, //CanIf_ControllerWakeup,
     NULL //CanIf_Arc_Error,
 };
const Can_ConfigSetType Can_ConfigSetData ={Can_ControllerCfgData,&CanCallbackConfigData};
const Can_ConfigType Can_ConfigData ={&Can_ConfigSetData};

